home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / unmaxvid.rexx < prev    next >
OS/2 REXX Batch file  |  1995-11-21  |  3KB  |  103 lines

  1. /* UnMaxVid.rexx V3.0 -- Put in and out points in a bit.                  */
  2. /* By Bob Caron (Grue) ©1995 NewTek Inc.                                  */
  3.  
  4. arg frompopup
  5. if frompopup="" then frompopup=0
  6.  
  7. call remlib('PROJECT_REXX_PORT')
  8.  
  9. call addlib('PROJECT_REXX_PORT',0)
  10. call set_view(2)
  11.  
  12. call req_error("UnMaxVid Length V3.0   ---  Sets in and out points of video croutons 1 second in.")
  13.  
  14. done=0
  15. do while done=0
  16.   selection=req_tell("UnMaxVid Length V3.0","'Continue' to effect ALL croutons","'Cancel' to effect selected croutons")
  17.   done=1
  18.   if selection=0 & frompopup=0 then do
  19.     if req_tell("Error:","You can only use this feature if you","launch this script from the tools","popup menu.")=0 then call quit()
  20.     done=0
  21.     end
  22. end
  23. if selection=1 then frompopup=0 else frompopup=1
  24.  
  25. project_end=croutonsinproject()
  26. location=1
  27. do count=1 to project_end
  28.   if croutonselectedpos(count)=1 | frompopup=0 then do
  29.      selected.location=count-1
  30.      location=location+1
  31.      end
  32. end
  33.  
  34. location=location-1
  35.  
  36. vidin=0;vidout=0;audin=0;audout=0;done=-1
  37. buttons='1111'
  38. do while done=-1
  39.   buttons=req_buttons("What would you like to effect:",buttons,"Vid In","Vid Out","AudIn","AudOut")
  40.   if buttons="CANCEL" then call quit
  41.  
  42.   if substr(buttons,1,1)="1" then do
  43.      vidin=1; done=1
  44.      end
  45.   if substr(buttons,2,1)="1" then do
  46.      vidout=1; done=1
  47.      end
  48.   if substr(buttons,3,1)="1" then do
  49.      audin=1; done=1
  50.      end
  51.   if substr(buttons,4,1)="1" then do
  52.      audout=1; done=1
  53.      end
  54. end
  55.  
  56. if frompopup="0" then do
  57.    if req_tell("Change ALL In and Out points","            Are You Sure?")=0 then call quit()
  58. end
  59. else
  60.    if req_tell("Change Selected In and Out points","            Are You Sure?")=0 then call quit()
  61.  
  62. extravid=0
  63. extraaud=0
  64. call req_open("Working... Please wait.")
  65. chunk=100/location;last=0;dots=0
  66. do count=1 to location
  67.    if crnumtype(selected.count)="CLIP" then do
  68.       fields=crnumgettag(selected.count,RecFields)
  69.       if fields<120 then break
  70.       out=fields-120
  71.       in=60
  72.       if vidin=1 then  call crnumsettag(selected.count,ClipStartField,in)
  73.       if audin=1 then  call crnumsettag(selected.count,AudioStart,in)
  74.       if vidout=1 then call crnumsettag(selected.count,Duration,out)
  75.       if audout=1 then call crnumsettag(selected.count,AudioDuration,out)
  76.       end
  77.       last=trunc(dots/10)+1
  78.       dots=dots+chunk;string=copies(".",trunc(dots/10)+1)
  79.       if (last~=trunc(dots/10)+1) then do
  80.          if (11-length(string)>-1) then
  81.             call req_error("[Working"||string||right('           ',11-length(string))||"]")
  82.          end
  83. end
  84.  
  85. call req_close()
  86. call req_error("All done.")
  87. call project_update()
  88. call remlib("PROJECT_REXX_PORT")
  89. exit
  90.  
  91. quit:
  92.  
  93. call req_error("Canceled.")
  94. call remlib("PROJECT_REXX_PORT")
  95.  
  96. exit
  97.  
  98. croutonselectedpos:
  99. arg pos
  100. row=trunc(pos/8)
  101. col=pos-(row*8)
  102. row=row+1
  103. return croutonselected(row,col)